<?php
declare (strict_types = 1);

namespace app\lib;

class Time {

    /**
     *  获取登录的失效时间
     * @param int $type
     * @return float|int
     */
    public static function getLoginExpireTime($type = 1) :int {
        $type = in_array($type, [1, 2]) ? $type : 1;
        $data = $type == 1 ? 7 : 30;

        return $data * 24 * 3600;
    }
}